package com.subject.shuati.common.enums;

import lombok.Getter;

/**
 * 响应状态枚举
 */
@Getter
public enum ResultCodeEnum {

    SUCCESS(200,"成功"),
    FAIL(500,"失败");
    public int code;
    public String msg;

    ResultCodeEnum(int code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public static ResultCodeEnum getByCode(int codeVal){
        for(ResultCodeEnum resultCodeEnum : ResultCodeEnum.values()){
            if(resultCodeEnum.code == codeVal){
                return resultCodeEnum;
            }
        }
        return null;
    }
}
